Video coding technique is one of the key techniques in digital media storage and transmission and other applications. The core technique in video coding system consists of prediction coding, transform coding and entropy coding. Entropy coding indicates to encode the syntax elements produced in the process of coding (such as motion vector, block identification, block-based prediction residual, etc.) by exploiting information entropy, which has the function of eliminating the statistical redundancy of data.
In the previous video coding standards, the methods for coding the block-based prediction residual include: 2D-VLC (Variable Length Coding) entropy encoder in H.261 and MPEG (Motion Picture Experts Group)-2 standards, 3D-VLC entropy encoder in H.263 and MPEG-4 standards, CAVLC (Context-based Adaptive Variable Length Coding) entropy encoder in H.264/AVC (H.264 Video Coding Suggestion by International Telecommunications Union ITU-T or the ISO/IEC international standard 14496-10, i.e. MPEG-4, part 10 of the standard) and CABAC (Context-based Adaptive Binary Arithmetic Coding) entropy encoder.
2D-VLC entropy encoder employs the (level, run)+EOB coding manner for coding the residual coefficient, wherein level indicates the non-zero coefficient of the residual image block after Discrete Cosine Transformed (DCT) and quantization, run indicates the number of coefficients with the value of 0, ranging from the coefficient “level” to the first non-zero coefficient, and EOB (End of Block) means the Endof Block, which solely occupies one position in the code table, that is to say, to assign EOB one codeword individually. EOB is combined with a sequence of (level, run) pair by 3D-VLC entropy encoder to form a three dimensional variable (level, run, last), in which last indicates whether the current coefficient is the last one in this block so that the relative short codeword previously occupied by EOB in the code table is free, and the joint probability for level, run and EOB is exploited, hence the coding efficiency is improved. Because CAVLC entropy encoder in H.264/AVC Video Coding Standard fully utilizes the context information, and optimizes the size of 4×4 block, nice coding performance is obtained although level and run are encoded separately. All the above mentioned entropy encoders are variable length encoders with the basic principle of Huffman coding, that is to say, coding the symbols with large probability by short code words, and coding the symbols which appear with small probability by long code words in order to achieve the final purpose that the average code length is the shortest. CABAC entropy encoder in H.264/AVC Video Coding Standard is the arithmetic encoder. The arithmetic encoder has better capability than the variable length encoder. And because CABAC can realize fine modeling of the context, the probability of appearing the source symbols can be estimated more accurately, so that the coding efficiency is very high. But comparing with the variable length encoder, the arithmetic encoder has higher computational complexity as well as more complicated hardware implementation, in other words, the improvement of coding efficiency is exchanged by higher complexity of the software and hardware.
In consideration of the two aspects of the coding efficiency and the software and hardware implementation complexity, variable length coding is an entropy coding solution with a higher cost-performance ratio. In the variable length encoder, 2D-VLC entropy encoder exploits the joint probability of level and run, theoretically, the efficiency is higher than the manner of separately coding level and run by CAVLC entropy encoder. And comparing with 3D-VLC encoder, the code table of 2D-VLC is smaller in size. Therefore, 2D-VLC entropy encoder considers both the coding efficiency and the hardware implementation complexity. But the traditional 2D-VLC entropy encoder is coding by obtaining a single code table through global statistic, it has the defect that the single code table can not adapt well to the variation of local probability distributions so that the coding efficiency is lower.